/*=====================================================
 Copyright (C) ETERNAL<iqstar@ms24.hinet.net>
 URL : http://www.et99.net

请仔细阅读以下许可协议。当您使用本软体，您将自动成为本协议的一方并受到本协议的约束。

软体和文档受到台湾及中国大陆著作权法及国际条约的保护。您不得：
a)营利、出租或者出借软体或文档的任何部分。
b)反向工程、分解、反编译或者企图察看软体的源代码作为商业用途。
c)修改或者改变软体，或者与其他程式结合。

许可人保留软体及文档的所有权利和权益。您不能通过本许可协定获得软体的任何所有权和知识产权。
===================================================== */
//##### team  #######
function team_view()
{
	w_c('<form action="wog_act.php" method="post" target="mission">');	
	w_c(temp_table1);
	w_c('<tr><td><input type="button" value="队伍列表" onClick="parent.act_click(\'team\',\'list\')"></td></tr>');
	w_c('<tr><td><input type="button" value="队伍状态" onClick="parent.act_click(\'team\',\'status\')"></td></tr>');
	w_c('<tr><td><input type="button" value="创立队伍" onClick="parent.team_creat();"></td></tr>');
	w_c('<tr><td><input type="button" value="离开队伍" onClick="parent.act_click(\'team\',\'leave\')"></td></tr>');
	w_c('<tr><td><input type="button" value="认领队员" onClick="parent.act_click(\'team\',\'get_member\')"></td></tr>');
	w_c(temp_table2);
	w_c('</form>');
	p_c();
};
function team_list(saletotal,page,s)
{
	
	w_c('<form action="wog_act.php" method="post" name=pageform target="mission">');
	pagesplit(saletotal,page);
	w_c('<input type="hidden" name="page" value="">');
	w_c('<input type="hidden" name="f" value="team">');
	w_c('<input type="hidden" name="act" value="list">');
	w_c('</form>');
	w_c('<form action="wog_act.php" method="post" target="mission">');
	w_c(temp_table1);
	if(s!="")
	{
		w_c('<tr><td></td><td>队长昵称</td><td>队长等级</td><td>队伍名称</td><td>人数</td></tr>');
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{
			var s2=s1[i].split(",");
			w_c('<tr><td ><input type="radio" name="t_id" value="'+s2[0]+'" ></td><td >'+s2[3]+'</td><td >'+s2[4]+'</td><td >'+s2[1]+'</td><td >'+s2[2]+'</td></tr>');
		}
		var dbsts_join="";
		var dbsts_leave="";
		if(t_team!="")
		{
			dbsts_join="disabled";
		}else
		{
			w_c('<input type="hidden" name="f" value="team"><input type="hidden" name="act" value="join">');
		}
		w_c('<tr><td colspan="5" align="center"><input type="submit" value="加入队伍"  '+dbsts_join+' ></td></tr>');
	}else
	{
		w_c('<tr><td colspan="4" align="center">目前无队伍</td></tr>');
	}
	w_c(temp_table2);
	w_c('</form>');
	p_c();
};
function team_creat()
{
	w_c('<form action="wog_act.php" method="post" target="mission">');
	w_c(temp_table1);
	w_c('<tr><td>队伍名称 <input type="text" name="t_name" size="16" maxlength="20"> <input type="button" value="决定" onClick="parent.act_click(\'team\',\'creat\',this.form.t_name.value)"> </td></tr>');
	w_c(temp_table2);
	w_c('</form>');
	p_c();
};
function team_status(s,time_line,support,my_id,adm)
{
	w_c('<form action="wog_act.php" method="post" target="mission">');
	w_c(temp_table1);
	w_c('<tr><td>选择</td><td>名称</td><td>等级</td><td>状态</td></tr>');
	var s1=s.split(";");
	if(s!="")
	{
		for(var i=0;i<s1.length;i++)
		{
			var s2=s1[i].split(",");
			var chk="";
			var dis="";
			var dis2="";
			if(s2[0]==support)
			{
				chk="checked";
			}
			if(s2[0]==my_id)
			{
				dis="disabled";
			}
			if(adm=="0")
			{
				dis2="disabled";
			}
			if( (time_line-parseInt(s2[3])) < 600 )
			{
				w_c('<tr><td ><input type="radio" name="p_id" value="'+s2[0]+'" '+chk+' '+dis+'></td><td >'+s2[1]+'</td><td >'+s2[2]+'</td><td >在线</td></tr>');
			}else
			{
				w_c('<tr bgcolor="#474747"><td ><input type="radio" name="p_id" value="'+s2[0]+'" '+chk+' '+dis+'></td><td >'+s2[1]+'</td><td >'+s2[2]+'</td><td >离线</td></tr>');
			}
		}
		w_c('<tr><td colspan="4" align="center"><input type="button" value="加入队频" onClick="parent.act_click(\'team\',\'chat\')">  <input type="button" value="踢除队员" onClick="parent.foot_turn(\'team\',\'del\',null,null,this.form.p_id)" '+dis2+'></td></tr>');
	}
	w_c(temp_table2);
	w_c('</form>');
	p_c();
};
function team_join_list(s)
{
	w_c('<form action="wog_act.php" method="post" target="mission">');	
	w_c(temp_table1);
	w_c('<tr><td></td><td>内容</td><td>等级</td><td>职业</td></tr>')
	if(s!="")
	{
		var s1=s.split(";");
		for(var i=0;i<s1.length;i++)
		{
			var s2=s1[i].split(",");
			w_c('<tr><td><input type="radio" name="t_j_id" value="'+s2[0]+'" ></td><td>'+s2[1]+' 提出加入队伍申请</td><td>'+s2[2]+'</td><td>'+s2[3]+'</td></tr>');
		}
		w_c('<tr><td colspan="4" align="center"><input type="button" value="邀请加入" onClick="parent.foot_turn(\'team\',\'get_save_member\',null,null,this.form.t_j_id)" ></td></tr>');
	}else
	{
		w_c('<tr><td colspan="5" align="center">没有玩家申请加入队伍</td></tr>');
	}
	w_c(temp_table2);
	w_c('</form>');
	p_c();
};
